﻿//
//  GNS_Calendar.h
//  MobileManageSys
//
//  Created by mr.l on 16/1/16.
//
//

#ifndef __MobileManageSys__GNS_Calendar__
#define __MobileManageSys__GNS_Calendar__
#include "cocos2d.h"
#include "ui/CocosGUI.h"
#include <map>
#include <vector>

USING_NS_CC;
using namespace ui;

class GNS_Calendar : public cocos2d::Layer
{
public:
    GNS_Calendar();
    ~GNS_Calendar();
    static GNS_Calendar * createCalendar();
    virtual bool init();
    CREATE_FUNC(GNS_Calendar);
    
	void SetCalendBgImage(std::string ImageName){};
	void SetCalendBg(std::string ImageName);
    void BtnCallBack(Ref * pSender , ui::Widget::TouchEventType type);
    virtual void TouchEvnets(Touch * pTouch , Event *pEvents);
    void Show(bool bShow);
    void pageViewEvent(cocos2d::Ref* sender, cocos2d::ui::PageView::EventType type);
    std::vector<Button *> *GetTimeButton();
	void setButtonsCallback(const Widget::ccWidgetTouchCallback& callback);
private:
    void SetTimeDate();
    void AddTimeDate();
    void updateLabel	();
private:
    EventListenerTouchOneByOne *listener;
    Sprite * TouchEventSpt;
    Size CalendarSize;
    bool m_bIsClickWndOutSideClose;
    Label * TimeLabel;
    std::map<int, std::vector<int > >_TimeMap;
    int day;
    int CurrentPageNum;
    PageView*pPageView;
    std::vector<Button *> _TimeButton;
public:
    Sprite * CalendarBg;
	int _defaultMon;
    int Mon;
    int year;

};
#endif /* defined(__MobileManageSys__GNS_Calendar__) */
